package org.home.and.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liou
 */
@RestController
@RefreshScope
public class TestController {

    @Value("${user.name}")
    private String userName;

    @Value("${user.age}")
    private String userAge;

    @GetMapping(value ="/echo/{str}")
    public String echo(@PathVariable String str) {
        return "hello Nacos discovery" + str + "---UserName:" + userName + "--UserAge:"+userAge;
    }
}
